package com.jd.service.impl;


import com.jd.mapper.CarouselMapper;
import com.jd.pojo.Carousel;
import com.jd.service.CarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * 轮播图业务层
 */
@Service
public class CarouselServiceImpl  implements CarouselService{

    @Autowired
    private CarouselMapper carouselMapper;

    @Override
    public List<Carousel> queryAll(Integer isShow) {
        Example example=new Example(Carousel.class);
        example.orderBy("sort").desc();
        Example.Criteria userCriteria = example.createCriteria();
        userCriteria.andEqualTo("isShow",isShow);
        List<Carousel>  result=carouselMapper.selectByExample(example);
        return result;
    }
}




